import request from '@/utils/request'

/**
 * 帖子分页
 */
export const getPage = (data) =>{
  return request({
    url: '/api/posts/getPage',
    method: 'post',
    data
  })
};

/**
 * 帖子发布
 */
export const add = (data) =>{
  return request({
    url: '/api/posts/add',
    method: 'post',
    data
  })
};

/**
 * 帖子详情
 */
export const getDetail = (id) =>{
  return request({
    url: '/api/posts/getDetail',
    method: 'get',
    params: {
      id: id
    }
  })
};

/**
 * 帖子浏览
 */
export const browse = (id) =>{
  return request({
    url: '/api/posts/browse',
    method: 'get',
    params: {
      id: id
    }
  })
};
